# 1）输入一个整数，判断是否为回文数（正读反读相同）
# a=list(input("请输入一个整数"))
# if (a[::-1])== a:
#     print("是回文数")
# else:
#     print("不是回文数")
# 2）选做：打印一个九九乘法表，结果如图所示
# for x in range(1,10):
#      for y in range(1,x+1):
#         print(f"{y}*{x}={x*y}",end='\t') #\t 字符差不多的情况下默认对齐
#      print()
# 3）使用for循环去打印列表元素，打印结果如下：
#      第1个元素：xx
#      第2个元素：xxx
#      .....
# ls=[1,1,1,2,3,4,5,6,7,8,2,4,3,5,6,5,75,4,34,5]
# for n in ls:
#     print(f"第{n+1}个元素：",ls[n])
# 4）删除列表中的重复元素
# ls=[1,1,2,3,4,5,6,7,8,2,4,3,5,6,5,75,4,34,5,1]
# 第一种 #有问题，多个重复的
# for x in ls:
#     if ls.count(x) >1:
#         ls.remove(x)
# print(ls)
# 第二种
# a = list(set(list))
# print(a)
# 第三种 #建一个空表，不重复的给放进空表中
# nu1= input("请输入列表内容：")
# Ist = list(nu1)
# print("原始列表:" ,lst)
# Ist1 = []
# for yuansu in lst:
#     if yuansu not in lst1:
#         lst1.append(yuansu)
# print（"去重后列表",lst1）
# 第四种 #建一个空表，不重复的给放进空表中
#n = [2, 3, 4, 6, 75,45,6, 5, 3, 5]
# seen = []
# for i in range(len(n)-1,-1,-1):
#     if i in seen:
#         del i
#     else:
#         seen.append(i)
# print(seen)
# print(n)
# n = [2, 3, 4, 6, 75,45,6, 5, 3, 5]
# seen = []
# for i in n:
#     if i not in seen:
#         seen.append(i)
# print(seen)
# print(n)
# 5）判断一个数是不是质数（只能被1和自己整除）
#第一种
# a=int(input("请输入一个整数"))
# if a <= 1:
#     print(f"{a}不是质数")
# else:
#     is_prime = True
#     for x in range(2, a):
#         if a%x == 0:
#             is_prime = False
#             break
#     if is_prime:
#         print(f"{a}是质数")
#     else:
#         print(f"{a}不是质数")
#第二种
# a=int(input("请输入一个整数"))
# if a <= 1:
#     print(f"{a}不是质数")
# else:
#     is_prime = True
#     for x in range(2,a):
#         for y in range(2,a):
#             if x*y == a:
#                 is_prime = False
#                 break
#     if is_prime:
#         print(f"{a}是质数")
#     else:
#         print(f"{a}不是质数")
# 6）打印出列表中每个元素出现的次数 打印格式为：元素xx出现的次数为x次
# a=[1,2,3,3,4,5,2,3221,4,14,2,4]
# b = int(input("请输入要统计的数字："))
# count=a.count(b)
# print(f"元素{b}出现的次数为{count}次")
# 7）找出两个列表中相同的元素
a=[1,2,3,3,4,5,2,3221,4,14,2,4]
b=[1,1,1,2,3,4,5,6,7,8,2,4,3,5,6,5,75,4,34,5]
# for x in a:
#     for y in b:
#         if x == y:
#          print(x)

# ls=(a and b)
# print(ls)
# for x in a:
#     for y in b:
#         if x == y:
#          print(x)

c=list(set(a))
d=list(set(b))
for x in c:
    for x in d:
          print(f"相同元素是{x}")